from poque.icm import *

def main():

    # http://www.sitandgoplanet.com/sitandgo/sng_bubble/Introduction_to%20ICM.html
    payout = [50, 30, 20]
    total_chips = 10000
    ICM.eliminate_player_print(payout, total_chips, 2500, 5000, 4)

    stacks = [100, 200, 220, 1000, 340, 140]
    ICM.chop_print(payout, stacks)

    # http://forumserver.twoplustwo.com/25/probability/tourney-chop-chip-chop-vs-icm-117430/
    stacks = [15000000, 10000000, 5000000]
    payout = [300000, 150000, 100000]
    ICM.chop_print(payout, stacks)

    stacks = [1500, 4000, 3500, 1000]
    payout = [500, 300, 200]
    ICM.chop_print(payout, stacks)

    # TODO: call method to calculate these chip counts 
    call_win = [2500, 4000, 3500, 0]
    call_tie = [1500, 4000, 3500, 1000]
    call_lose = [500, 4000, 3500, 2000]
    fold = [1300, 4000, 3500, 1200]
    # TODO: call poker odds calc to get win & lose & tie odds on a hand preflop
    cai = ICM.evaluate_monetaryEV(payout, call_win, call_tie, call_lose, fold, .5295, .4309, .0396)
    print ''
    print 'mEV: call equity ${0:.2f} vs fold equity ${1:.2f}, thus {2}'.format(cai['call_equity'], cai['fold_equity'], cai['action'])


if __name__ == '__main__':
    main()
